cmake_minimum_required(VERSION 3.8)
project(ros2_py_pkg)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(ros_ign_gazebo REQUIRED)
find_package(example_interfaces REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
    "srv/OddEvenCheck.srv"
    "srv/TurnCamera.srv"
    "action/Navigate.action"
    "action/MoveRobot.action"
    DEPENDENCIES
    sensor_msgs geometry_msgs
)

ament_python_install_package(src)

install(PROGRAMS
  src/publisher.py
  src/subscriber.py
  src/rpm_pub.py
  src/speed_calc.py
  src/service_server.py
  src/service_client.py
  src/turn_camera_server.py
  src/turn_camera_client.py
  src/action_server.py
  src/action_client.py
  src/move_robot_server.py
  src/move_robot_client.py
  DESTINATION lib/${PROJECT_NAME}
)

install(DIRECTORY
  launch
  DESTINATION share/${PROJECT_NAME}/
)

install(DIRECTORY
  models
  DESTINATION share/${PROJECT_NAME}/
)

install(DIRECTORY
  worlds
  DESTINATION share/${PROJECT_NAME}/
)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)

  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
